package com.vivi.feverdiagnose;

import com.vivi.feverdiagnose.R;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Gravity;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class LoginPakar extends Activity {
	private EditText inputUser, inputPass;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.login_pakar);
		
	}

	public void onButtonClicker(View v) {
		Intent intent;

		switch (v.getId()) {
		case R.id.btnLoginMasuk:
			inputUser = (EditText) findViewById(R.id.editUserName);
			inputPass = (EditText) findViewById(R.id.editPassword);
			
			if (inputUser.getText().toString().equals("admin") && inputPass.getText().toString().equals("asdqwe")) {
				intent = new Intent(this, MenuPakar.class);
				startActivity(intent);
			}else{
				Toast toast= Toast.makeText(getApplicationContext(), "Login salah!!.", Toast.LENGTH_SHORT);  
	    		toast.setGravity(Gravity.CENTER_VERTICAL|Gravity.CENTER_HORIZONTAL, 0, 0);
	    		toast.show();
			}
			break;
		}
	}
}
